#include "Import.h"
#include "IVisitor.h"

Import::Import(const AliasTypeList& names, int nodeId):
    stmtType(nodeId),
    _names(names)
{
}
    
Import::~Import()
{
    _names.clear();
}
    
Ast::AstTypes Import::type() const
{
    return Ast::Import;
}
    

AliasTypeList Import::names()
{
    return _names;
}

void Import::setNames(const AliasTypeList& names)
{
    _names = names;
}

    
QString Import::toString() const
{
    return QString("Import[names=%1]").
                arg(_names.toString());
}
    
void Import::accept(IVisitor* visitor, const SimpleNodePtr& node)
{
    visitor->visitImport(node.dynamicCast<Import>());
}
    
void Import::traverse(IVisitor* visitor)
{
    _names.traverse(visitor);
}